package com.smart.platform.common;

/**
 * 基于ThreadLocal封装工具类，用户保存和获取当前登录用户userId
 */
public class BaseContext {
    private static final ThreadLocal<String> threadLocal = new InheritableThreadLocal<>();

    public static void setCurrentUserId(String userId) {
        threadLocal.set(userId);
    }

    public static String getCurrentUserId() {
        return threadLocal.get();
    }
}
